clipboard: Don't crash when data is requested from NULL window
authorBenjamin Otte <otte@redhat.com>
Fri, 13 Dec 2013 15:22:04 +0000 (16:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 13 Dec 2013 18:07:42 +0000 (19:07 +0100)
This could happen if data was requested from a separate screen now that
multi-screen is no longer supported.

Ideally, we'd want to support copying to other screens, but that
requires solving in GDK as that's X-specific so cannot be well
abstracted by GDK (without the reintroduction of multiple screens).

https://bugzilla.gnome.org/show_bug.cgi?id=719314

gtk/gtkselection.c

index 84095c42164279e8b20645c6f0b1db7202b03a8e..e20d464b800b84b563986b2e2f1d2955f2e2d04c 100644 (file)
@@ -2294,6 +2294,9 @@ _gtk_selection_request (GtkWidget *widget,
   int i;
   gulong selection_max_size;
 
+  if (event->requestor == NULL)
+    return;
+
   if (initialize)
     gtk_selection_init ();